#include "mpHttpResponseStreamContent.h"
#include "mpLog.h"

#if defined(MAPLE_MODE_DEBUGGING)
#include "mpLocaleUtils.h"
#endif


namespace MP{
namespace HTTP{
namespace INTERNAL{

HttpResponseStreamContent::HttpResponseStreamContent(std::stringstream& stream)
    :_stream(stream)
{
}

void HttpResponseStreamContent::beginReadData(){
    _stream.str(std::string());
    _stream.clear();
}


void HttpResponseStreamContent::onReadDataSome(const char* data, std::size_t length){
    _stream.write(data,length);

#if defined(MAPLE_MODE_DEBUGGING)
    std::string tmp;
    tmp.append(data,length);
    MPLOG_INFO << SYS_TEXT(tmp);
#endif
}

void HttpResponseStreamContent::endReadData(){

}


}   //INTERNAL
}   //HTTP
}   //MP
